package map.gui.config;

import java.awt.BorderLayout;
import java.awt.ComponentOrientation;
import java.awt.Dimension;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Point;
import java.util.Vector;

import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.SwingConstants;
import javax.swing.table.DefaultTableModel;
import javax.swing.BorderFactory;
import java.awt.Color;

public class DeviceModelConfig extends JFrame {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
//	private JFrame jFrameConig = null;  //  @jve:decl-index=0:visual-constraint="576,49"
	private JPanel jContentPane = null;
	private JPanel jPanelListAPIModel = null;
	private JLabel jLabelDeviceList = null;
	private JComboBox jComboBoxDeviceList = null;
	private JPanel jPanelDevices = null;
	private JPanel jPanelWidgetList = null;
	private JPanel jPanelDetails = null;
	private JList jListDevicesList = null;
	private JLabel jLabelAPiModel = null;
	private JLabel jLabelMappingED = null;
	private JScrollPane jScrollPane = null;
	private JTable jTableMapEA = null;
	private JLabel jLabelWidgetsList = null;
	private JList jListUInteractions = null;
	private JLabel jLabelWidgetsDetails = null;
	private JLabel jLabelDeviceName = null;
	private JLabel jLabelDeviceNameValue = null;
	private JLabel jLabelEventsList = null;
	private JScrollPane jScrollPane1 = null;
	private JTable jTableWidgetsMapEB = null;
	private JLabel jLabelWidgetsProperties = null;
	private JScrollPane jScrollPane2 = null;
	private JTable jTableWidgetsPE = null;
	/**
	 * This method initializes jFrameConig	
	 * 	
	 * @return javax.swing.JFrame	
	 */
/*	private JFrame getJFrameConig() {
		if (jFrameConig == null) {
			jFrameConig = new JFrame();
			jFrameConig.setName("frameConfigAPI");
			jFrameConig.setTitle("Devices Settings");
			jFrameConig.setLocation(new Point(50, 50));
			jFrameConig.setPreferredSize(new Dimension(700, 500));
			jFrameConig.setMaximumSize(new Dimension(700, 500));
			jFrameConig.setMinimumSize(new Dimension(700, 500));
			jFrameConig.setResizable(false);
			jFrameConig.setVisible(false);
			jFrameConig.setContentPane(getJContentPane());
		}
		return jFrameConig;
	}
*/
	public DeviceModelConfig() {
		super();
		initialize();
	}

	private void initialize() {
		this.setName("frameConfigAPI");
		this.setTitle("Devices Settings");
		this.setLocation(new Point(320, 320));
		this.setPreferredSize(new Dimension(700, 500));
		this.setMaximumSize(new Dimension(700, 500));
		this.setMinimumSize(new Dimension(700, 500));
		this.setResizable(false);
		this.setVisible(false);
		this.setContentPane(getJContentPane());

	}

	/**
	 * This method initializes jContentPane	
	 * 	
	 * @return javax.swing.JPanel	
	 */
	private JPanel getJContentPane() {
		if (jContentPane == null) {
			jContentPane = new JPanel();
			jContentPane.setLayout(new BorderLayout());
			jContentPane.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
			jContentPane.add(getJPanelListAPIModel(), BorderLayout.NORTH);
			jContentPane.add(getJPanelDevices(), BorderLayout.WEST);
			jContentPane.add(getJPanelWidgetList(), BorderLayout.CENTER);
			jContentPane.add(getJPanelDetails(), BorderLayout.EAST);
		}
		return jContentPane;
	}

	/**
	 * This method initializes jPanelListAPIModel	
	 * 	
	 * @return javax.swing.JPanel	
	 */
	private JPanel getJPanelListAPIModel() {
		if (jPanelListAPIModel == null) {
			GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
			gridBagConstraints1.fill = GridBagConstraints.VERTICAL;
			gridBagConstraints1.gridy = 0;
			gridBagConstraints1.weightx = 1.0;
			gridBagConstraints1.gridx = 1;
			GridBagConstraints gridBagConstraints = new GridBagConstraints();
			gridBagConstraints.gridx = 0;
			gridBagConstraints.gridy = 0;
			jLabelDeviceList = new JLabel();
			jLabelDeviceList.setText("Devices ");
			jLabelDeviceList.setHorizontalAlignment(SwingConstants.CENTER);
			jLabelDeviceList.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
			jPanelListAPIModel = new JPanel();
			jPanelListAPIModel.setLayout(new GridBagLayout());
			jPanelListAPIModel.setPreferredSize(new Dimension(10, 40));
			jPanelListAPIModel.add(jLabelDeviceList, gridBagConstraints);
			jPanelListAPIModel.add(getJComboBoxDeviceList(), gridBagConstraints1);
		}
		return jPanelListAPIModel;
	}

	/**
	 * This method initializes jComboBoxDeviceList	
	 * 	
	 * @return javax.swing.JComboBox	
	 */
	private JComboBox getJComboBoxDeviceList() {
		if (jComboBoxDeviceList == null) {
			jComboBoxDeviceList = new JComboBox();
			jComboBoxDeviceList.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
			jComboBoxDeviceList.setToolTipText("Select Widgets Model");
		}
		return jComboBoxDeviceList;
	}

	/**
	 * This method initializes jPanelDevices	
	 * 	
	 * @return javax.swing.JPanel	
	 */
	private JPanel getJPanelDevices() {
		if (jPanelDevices == null) {
			GridBagConstraints gridBagConstraints6 = new GridBagConstraints();
			gridBagConstraints6.fill = GridBagConstraints.BOTH;
			gridBagConstraints6.weighty = 1.0;
			gridBagConstraints6.gridy = 3;
			gridBagConstraints6.gridx = 0;
			gridBagConstraints6.weightx = 1.0;
			GridBagConstraints gridBagConstraints4 = new GridBagConstraints();
			gridBagConstraints4.gridx = 0;
			gridBagConstraints4.gridy = 2;
			jLabelMappingED = new JLabel();
			jLabelMappingED.setText("Mappings Events Actions");
			GridBagConstraints gridBagConstraints3 = new GridBagConstraints();
			gridBagConstraints3.gridx = 0;
			gridBagConstraints3.gridy = 0;
			jLabelAPiModel = new JLabel();
			jLabelAPiModel.setText("API Model");
			GridBagConstraints gridBagConstraints2 = new GridBagConstraints();
			gridBagConstraints2.fill = GridBagConstraints.BOTH;
			gridBagConstraints2.gridy = 1;
			gridBagConstraints2.weightx = 1.0;
			gridBagConstraints2.weighty = 1.0;
			gridBagConstraints2.gridx = 0;
			jPanelDevices = new JPanel();
			jPanelDevices.setLayout(new GridBagLayout());
			jPanelDevices.setPreferredSize(new Dimension(190, 10));
			jPanelDevices.setBorder(BorderFactory.createLineBorder(Color.gray, 2));
			jPanelDevices.add(getJListDevicesList(), gridBagConstraints2);
			jPanelDevices.add(jLabelAPiModel, gridBagConstraints3);
			jPanelDevices.add(jLabelMappingED, gridBagConstraints4);
			jPanelDevices.add(getJScrollPane(), gridBagConstraints6);
		}
		return jPanelDevices;
	}

	/**
	 * This method initializes jPanelWidgetList	
	 * 	
	 * @return javax.swing.JPanel	
	 */
	private JPanel getJPanelWidgetList() {
		if (jPanelWidgetList == null) {
			GridBagConstraints gridBagConstraints7 = new GridBagConstraints();
			gridBagConstraints7.fill = GridBagConstraints.BOTH;
			gridBagConstraints7.gridy = 1;
			gridBagConstraints7.weightx = 1.0;
			gridBagConstraints7.weighty = 1.0;
			gridBagConstraints7.gridx = 0;
			GridBagConstraints gridBagConstraints5 = new GridBagConstraints();
			gridBagConstraints5.gridx = 0;
			gridBagConstraints5.gridy = 0;
			jLabelWidgetsList = new JLabel();
			jLabelWidgetsList.setText("User Interactions");
			jPanelWidgetList = new JPanel();
			jPanelWidgetList.setLayout(new GridBagLayout());
			jPanelWidgetList.setBorder(BorderFactory.createLineBorder(Color.gray, 2));
			jPanelWidgetList.add(jLabelWidgetsList, gridBagConstraints5);
			jPanelWidgetList.add(getJListUInteractions(), gridBagConstraints7);
		}
		return jPanelWidgetList;
	}

	/**
	 * This method initializes jPanelDetails	
	 * 	
	 * @return javax.swing.JPanel	
	 */
	private JPanel getJPanelDetails() {
		if (jPanelDetails == null) {
			GridBagConstraints gridBagConstraints14 = new GridBagConstraints();
			gridBagConstraints14.fill = GridBagConstraints.BOTH;
			gridBagConstraints14.gridy = 5;
			gridBagConstraints14.weightx = 1.0;
			gridBagConstraints14.weighty = 1.0;
			gridBagConstraints14.gridx = 2;
			GridBagConstraints gridBagConstraints13 = new GridBagConstraints();
			gridBagConstraints13.gridx = 2;
			gridBagConstraints13.gridy = 4;
			jLabelWidgetsProperties = new JLabel();
			jLabelWidgetsProperties.setText("Properties List");
			GridBagConstraints gridBagConstraints12 = new GridBagConstraints();
			gridBagConstraints12.fill = GridBagConstraints.BOTH;
			gridBagConstraints12.gridy = 3;
			gridBagConstraints12.weightx = 1.0;
			gridBagConstraints12.weighty = 1.0;
			gridBagConstraints12.gridx = 2;
			GridBagConstraints gridBagConstraints11 = new GridBagConstraints();
			gridBagConstraints11.gridx = 2;
			gridBagConstraints11.gridy = 2;
			jLabelEventsList = new JLabel();
			jLabelEventsList.setText("Events List");
			GridBagConstraints gridBagConstraints9 = new GridBagConstraints();
			gridBagConstraints9.gridx = 3;
			gridBagConstraints9.gridy = 1;
			jLabelDeviceNameValue = new JLabel();
			jLabelDeviceNameValue.setText("XXX");
			GridBagConstraints gridBagConstraints10 = new GridBagConstraints();
			gridBagConstraints10.gridx = 0;
			gridBagConstraints10.gridy = 1;
			jLabelDeviceName = new JLabel();
			jLabelDeviceName.setText("Name:");
			GridBagConstraints gridBagConstraints8 = new GridBagConstraints();
			gridBagConstraints8.gridx = 2;
			gridBagConstraints8.anchor = GridBagConstraints.NORTH;
			gridBagConstraints8.gridy = 0;
			jLabelWidgetsDetails = new JLabel();
			jLabelWidgetsDetails.setText("Details");
			jLabelWidgetsDetails.setVerticalTextPosition(SwingConstants.TOP);
			jLabelWidgetsDetails.setVerticalAlignment(SwingConstants.TOP);
			jPanelDetails = new JPanel();
			jPanelDetails.setLayout(new GridBagLayout());
			jPanelDetails.setPreferredSize(new Dimension(190, 0));
			jPanelDetails.setBorder(BorderFactory.createLineBorder(Color.gray, 2));
			jPanelDetails.add(jLabelWidgetsDetails, gridBagConstraints8);
			jPanelDetails.add(jLabelDeviceName, gridBagConstraints10);
			jPanelDetails.add(jLabelDeviceNameValue, gridBagConstraints9);
			jPanelDetails.add(jLabelEventsList, gridBagConstraints11);
			jPanelDetails.add(getJScrollPane1(), gridBagConstraints12);
			jPanelDetails.add(jLabelWidgetsProperties, gridBagConstraints13);
			jPanelDetails.add(getJScrollPane2(), gridBagConstraints14);
		}
		return jPanelDetails;
	}

	/**
	 * This method initializes jListDevicesList	
	 * 	
	 * @return javax.swing.JList	
	 */
	private JList getJListDevicesList() {
		if (jListDevicesList == null) {
			jListDevicesList = new JList();
			jListDevicesList.setPreferredSize(new Dimension(70, 70));
		}
		return jListDevicesList;
	}

	/**
	 * This method initializes jScrollPane	
	 * 	
	 * @return javax.swing.JScrollPane	
	 */
	private JScrollPane getJScrollPane() {
		if (jScrollPane == null) {
			jScrollPane = new JScrollPane();
			jScrollPane.setViewportView(getJTableMapEA());
		}
		return jScrollPane;
	}

	/**
	 * This method initializes jTableMapEA	
	 * 	
	 * @return javax.swing.JTable	
	 */
	private JTable getJTableMapEA() {
		if (jTableMapEA == null) {
			Vector<String> vector = new Vector<String>();
			vector.setSize(2);
			DefaultTableModel defaultTableModel = new DefaultTableModel();
			defaultTableModel.setColumnCount(2);
			defaultTableModel.setColumnIdentifiers(vector);
			defaultTableModel.setRowCount(8);
			jTableMapEA = new JTable();
			jTableMapEA.setModel(defaultTableModel);
		}
		return jTableMapEA;
	}

	/**
	 * This method initializes jListUInteractions	
	 * 	
	 * @return javax.swing.JList	
	 */
	private JList getJListUInteractions() {
		if (jListUInteractions == null) {
			jListUInteractions = new JList();
			jListUInteractions.setVisibleRowCount(200);
			jListUInteractions.setPreferredSize(new Dimension(190, 60));
		}
		return jListUInteractions;
	}

	/**
	 * This method initializes jScrollPane1	
	 * 	
	 * @return javax.swing.JScrollPane	
	 */
	private JScrollPane getJScrollPane1() {
		if (jScrollPane1 == null) {
			jScrollPane1 = new JScrollPane();
			jScrollPane1.setViewportView(getJTableWidgetsMapEB());
		}
		return jScrollPane1;
	}

	/**
	 * This method initializes jTableWidgetsMapEB	
	 * 	
	 * @return javax.swing.JTable	
	 */
	private JTable getJTableWidgetsMapEB() {
		if (jTableWidgetsMapEB == null) {
			DefaultTableModel defaultTableModel1 = new DefaultTableModel();
			defaultTableModel1.setColumnCount(2);
			defaultTableModel1.setRowCount(10);
			jTableWidgetsMapEB = new JTable();
			jTableWidgetsMapEB.setSize(new Dimension(127, 80));
			jTableWidgetsMapEB.setModel(defaultTableModel1);
		}
		return jTableWidgetsMapEB;
	}

	/**
	 * This method initializes jScrollPane2	
	 * 	
	 * @return javax.swing.JScrollPane	
	 */
	private JScrollPane getJScrollPane2() {
		if (jScrollPane2 == null) {
			jScrollPane2 = new JScrollPane();
			jScrollPane2.setViewportView(getJTableWidgetsPE());
		}
		return jScrollPane2;
	}

	/**
	 * This method initializes jTableWidgetsPE	
	 * 	
	 * @return javax.swing.JTable	
	 */
	private JTable getJTableWidgetsPE() {
		if (jTableWidgetsPE == null) {
			DefaultTableModel defaultTableModel2 = new DefaultTableModel();
			defaultTableModel2.setColumnCount(2);
			defaultTableModel2.setRowCount(20);
			jTableWidgetsPE = new JTable();
			jTableWidgetsPE.setModel(defaultTableModel2);
		}
		return jTableWidgetsPE;
	}

}
